/*
 *------------------------------------------------------------------------------
 * @File      :    ei_nna_md_define.h
 * @Date      :    2021-8-17
 * @Author    :    lomboswer <lomboswer@lombotech.com>
 * @Brief     :    Media Interface for MDP(Media Development Platform).
 *
 * Copyright (C) 2020-2021, LomboTech Co.Ltd. All rights reserved.
 *------------------------------------------------------------------------------
 */

#ifndef __EI_NNA_MD_DEFINE_H__
#define __EI_NNA_MD_DEFINE_H__

#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif

#include "ei_nna_define.h"

#define DEFAULT_NNA_MD_CONFIG_INFMT (0x02)
#define DEFAULT_NNA_MD_CONFIG_FG_THRESH (20)
#define DEFAULT_NNA_MD_CONFIG_DILATE_TIMES (3)
#define DEFAULT_NNA_MD_CONFIG_MSK_FILTER_STRENGTH (1)
#define DEFAULT_NNA_MD_CONFIG_MAX_BOX_NUM (256)
#define DEFAULT_NNA_MD_CONFIG_AX_FREQ (600)
#define DEFAULT_NNA_MD_CONFIG_INPUT_WIDTH (720)
#define DEFAULT_NNA_MD_CONFIG_INPUT_HEIGHT (608)
#define DEFAULT_NNA_MD_CONFIG_POOL_W (3)
#define DEFAULT_NNA_MD_CONFIG_POOL_H (3)
#define DEFAULT_NNA_MD_CONFIG_THR_ENABLE (1)
#define DEFAULT_NNA_MD_CONFIG_THR (20)
#define DEFAULT_NNA_MD_CONFIG_ALPHA (200)
#define DEFAULT_NNA_MD_CONFIG_RESET_FLAG (0)
#define DEFAULT_NNA_MD_CONFIG_MASK_THRESHOLD (1)

typedef EI_S32 NNA_MD_CHN;

typedef struct eiNNA_MOTION_S {
	/* x0,y0,x1,y1 */
	EI_S32 s32Rect[4];

	EI_S32 s32Area;
} EI_NNA_MOTION_S;

typedef struct eiNNA_MOTIONS_S {
	EI_S32 s32Num;
	EI_S32 s32AreaThr;
	EI_NNA_MOTION_S stObjs[DEFAULT_NNA_MD_CONFIG_MAX_BOX_NUM];
} EI_NNA_MOTIONS_S;

typedef struct eiNNA_MOTION_CHN_ATTR_S {
	EI_S32 s32InputWidth;
	EI_S32 s32InputHeight;
	/*! POOLING BLK_W/BLK_H */
	EI_S32 s32PoolW;
	EI_S32 s32PoolH;
	/*! FG MASK Threshold */
	EI_S32 s32ThresholdEnable;
	EI_S32 s32Threshold;
	/*! BG update alpha */
	EI_S32 s32Alpha;
	/*! Scene change */
	EI_S32 s32ResetFlag;
	/*! Pooling mask threshold */
	EI_S32 s32MaskThreshold;
} EI_NNA_MOTION_CHN_ATTR_S;

typedef struct eiNNA_MOTION_CONFIG_S {
	EI_CHAR *ModelRootPath;

	EI_S32 s32Width;
	EI_S32 s32Height;
	EI_S32 s32MaxObjsNum;
	// foreground filter threshold value, suggest setting range [5, 70]
	EI_S32 s32FgThreshold;
	// do dilate times, suggest setting range [1, 5],
	// if msk_filter_strength>0, dilate_times recommend the val set above 1
	EI_S32 s32DilateTimes;
	// msk foreground picture do filter in vertical direction,
	// 0: no filter 1: low-strength  2: mid-strength  3: high-strength
	EI_S32 s32MskFilterStrength;

	EI_NNA_AX_FREQ_S stFreq;
	EI_NNA_MOTION_CHN_ATTR_S stChAttr;
} EI_NNA_MOTION_CONFIG_S;


#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif

#endif /* __EI_NNA_MD_DEFINE_H__ */

